package org.java;

import java.util.Collection;
import java.util.Iterator;
import java.util.TreeMap;

public class DoTreeMap {
	public static void main(String[] args) {
		CollatorComparator comparator = new CollatorComparator();
		TreeMap<String, String> map = new TreeMap<String, String>(comparator);
//		TreeMap<String, String> map = new TreeMap<String, String>();
		for (int i = 0; i < 10; i++) {
			String s = "" + (int) (Math.random() * 1000);			
			map.put(s, s);
		}
			map.put("abcd", "abcd");
			map.put("Abc", "Abc");
			map.put("bbb","bbb");
			map.put("BBBB", "BBBB");
			map.put("北京","北京");
			map.put("中国","中国");
			map.put("上海", "上海");
			map.put("厦门", "厦门");
			map.put("香港", "香港");
			map.put("碑海", "碑海");
			
			
			
			Collection<String> col = map.values();
			Iterator<String> it = col.iterator();
			while(it.hasNext()) {
				System.out.println(it.next());
			}
		
	}

}
